import App from './App'
import uvUI from '@/uni_modules/uv-ui-tools'
import plugins from './plugins' // plugins

// 引入 uni-icons 组件
import uniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue';

// var script = document.createElement('script');
// script.src = "https://res.wx.qq.com/open/js/jweixin-1.6.0.js";
// document.body.appendChild(script);

// #ifdef VUE3
import { createSSRApp } from 'vue'
import { createPinia } from 'pinia';

export function createApp() {
    const app = createSSRApp(App);
    const pinia = createPinia();
    app.use(pinia); // 注册 Pinia
    app.use(uvUI);
    app.use(plugins);
    app.component('uni-icons', uniIcons);

    // ✅ 正确返回对象字面量（逗号分隔，合法格式）
    return {
        app,
        pinia
    };
}
// #endif
